import { createComponent } from './utils/component-factory';
import basicComponents from './basic';
import dataComponents from './data';
import feedbackComponents from './feedback';
import layoutComponents from './layout';

// 处理所有组件配置
const processComponents = (components) => {
  return components.map(config => {
    try {
      return createComponent(config);
    } catch (error) {
      console.error(`组件 ${config.name} 配置处理失败:`, error);
      return null;
    }
  }).filter(Boolean);
};

export const componentConfigs = [
  ...processComponents(basicComponents),
  ...processComponents(dataComponents),
  ...processComponents(feedbackComponents),
  ...processComponents(layoutComponents)
];